class_name Energy
extends Panel

@onready var label:Label=$Label
var stats:PlayerStatsSrc

func _ready():
	stats=Game.player.statsSrc
	if !stats.statsChanged.is_connected(renderEnergy):
		stats.statsChanged.connect(renderEnergy)
	renderEnergy()

func renderEnergy()->void:
	label.text ="%s/%s" % [stats.energy,stats.maxEnergy]

